/**
 * 全局样式
 */

/* 重置样式 */
page {
  height: 100%;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  background: #f5f0e8;
  font-family: 'STKaiti', 'KaiTi', serif;
  box-sizing: border-box;
}

* {
  box-sizing: border-box;
}

/* 全局变量 */
:root {
  --primary-color: #B8956A;
  --primary-light: #C3A57D;
  --primary-dark: #8C6E4B;
  --secondary-color: #A5875F;
  --accent-color: #D4AF76;
  --bg-color: #F5F0E8;
  --bg-light: #FAF8F3;
  --text-primary: #333333;
  --text-secondary: #666666;
  --text-tertiary: #999999;
  --text-light: #6B5438;
  --border-color: #E5D5C3;
  --shadow-sm: 0 2px 8px rgba(140, 110, 75, 0.1);
  --shadow-md: 0 4px 16px rgba(140, 110, 75, 0.15);
  --shadow-lg: 0 8px 32px rgba(140, 110, 75, 0.2);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  
  /* 苹果风格动画参数 */
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --ease-apple: cubic-bezier(0.25, 0.1, 0.25, 1);
  --duration-fast: 200ms;
  --duration-normal: 350ms;
  --duration-slow: 500ms;
}

/* 通用容器 */
.container {
  padding: 30px;
}

/* 通用卡片 */
.card {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 30px;
  box-shadow: var(--shadow-sm);
}

/* 通用按钮 */
.btn {
  display: inline-block;
  padding: 20px 40px;
  border-radius: var(--radius-lg);
  font-size: 28px;
  font-weight: 600;
  text-align: center;
  transition: all 0.3s ease;
  
  &.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: #fff;
    box-shadow: var(--shadow-md);
    
    &:active {
      transform: scale(0.95);
      box-shadow: var(--shadow-sm);
    }
  }
  
  &.btn-secondary {
    background: #fff;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    
    &:active {
      background: rgba(139, 69, 19, 0.05);
    }
  }
  
  &.btn-disabled {
    opacity: 0.5;
    pointer-events: none;
  }
}

/* 通用标题 */
.title {
  font-size: 40px;
  font-weight: 700;
  color: var(--primary-color);
  letter-spacing: 2px;
  font-family: 'STKaiti', 'KaiTi', serif;
  
  &.title-lg {
    font-size: 48px;
  }
  
  &.title-sm {
    font-size: 32px;
  }
}

/* 通用文本 */
.text {
  font-size: 28px;
  line-height: 1.6;
  color: var(--text-primary);
  
  &.text-secondary {
    color: var(--text-secondary);
  }
  
  &.text-tertiary {
    color: var(--text-tertiary);
  }
  
  &.text-lg {
    font-size: 32px;
  }
  
  &.text-sm {
    font-size: 24px;
  }
}

/* 通用分割线 */
.divider {
  height: 1px;
  background: var(--border-color);
  margin: 30px 0;
  
  &.divider-primary {
    background: linear-gradient(90deg, transparent 0%, var(--primary-color) 50%, transparent 100%);
    height: 2px;
  }
}

/* 通用加载动画 */
.loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* 通用淡入动画 */
.fade-in {
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* 通用滑入动画 */
.slide-up {
  animation: slideUp 0.5s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 通用缩放动画 */
.scale-in {
  animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* 苹果风格动画 */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(0.98);
  }
}

/* 液态玻璃效果 */
.glass-light {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.glass-medium {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: saturate(180%) blur(15px);
  -webkit-backdrop-filter: saturate(180%) blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.glass-dark {
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 动画工具类 */
.animate-in {
  animation: fadeInUp var(--duration-normal) var(--ease-smooth) backwards;
}

.animate-delay-1 {
  animation-delay: 100ms;
}

.animate-delay-2 {
  animation-delay: 200ms;
}

.animate-delay-3 {
  animation-delay: 300ms;
}

.animate-delay-4 {
  animation-delay: 400ms;
}

/* 悬停效果 */
.hover-lift {
  transition: transform var(--duration-fast) var(--ease-smooth), 
              box-shadow var(--duration-fast) var(--ease-smooth);
  
  &:active {
    transform: translateY(2px) scale(0.98);
  }
}

.hover-scale {
  transition: transform var(--duration-fast) var(--ease-apple);
  
  &:active {
    transform: scale(0.95);
  }
}

/* 通用工具类 */
.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-column {
  display: flex;
  flex-direction: column;
}

.mt-10 {
  margin-top: 10px;
}

.mt-20 {
  margin-top: 20px;
}

.mt-30 {
  margin-top: 30px;
}

.mb-10 {
  margin-bottom: 10px;
}

.mb-20 {
  margin-bottom: 20px;
}

.mb-30 {
  margin-bottom: 30px;
}

.p-10 {
  padding: 10px;
}

.p-20 {
  padding: 20px;
}

.p-30 {
  padding: 30px;
}

/* 传统纹样背景 */
.pattern-bg {
  position: relative;
  
  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
      repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(139, 69, 19, 0.03) 35px, rgba(139, 69, 19, 0.03) 70px);
    pointer-events: none;
  }
}

/* 滚动条样式（H5端） */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
  
  &:hover {
    background: var(--primary-dark);
  }
}

